/*
 * @Author: Zhang Yingying
 * @Date: 2020-11-05 16:12:20
 * @LastEditors: Zhang Yingying
 * @LastEditTime: 2020-11-24 21:24:04
 */
import BaseCrudApi from './BaseCrudApi'

export class ClassificationApi extends BaseCrudApi {
  constructor() {
    super('classification')
  }

  save(data) {
    return this.http.post(`/classification/save`, data)
  }

  getAll() {
    return this.http.get(`/classification/getAll`)
  }

  getPrimary() {
    return this.http.get(`/classification/getPrimary`)
  }

  remove(id) {
    return this.http.delete(`/classification/remove`, {
      params: {
        id,
      },
    })
  }

  getList({ name, capacity, offset }) {
    return this.http.get(`/classification/getList`, {
      params: {
        name,
        capacity,
        offset,
      },
    })
  }
}

export default new ClassificationApi()
